//
//  HelloWorldLayer.m
//  airplane
//
//  Created by gump gump on 5/17/12.
//  Copyright __MyCompanyName__ 2012. All rights reserved.
//


// Import the interfaces
#import "HelloWorldLayer.h"
#import "LayerManager.h"

// HelloWorldLayer implementation
@implementation HelloWorldLayer

+(CCScene *) scene
{
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	HelloWorldLayer *layer = [HelloWorldLayer node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

- (void) dealloc
{
	[super dealloc];
}

-(id) init
{
	if( (self=[super init])) {
		CCMenuItemFont *itemdanji = [CCMenuItemFont itemFromString: @"自慰" target:self selector:@selector(onDanji:)];
        CCMenuItemFont  *itemduizhan = [CCMenuItemFont itemFromString:@"本机对战" target:self selector:@selector(onDuiZhan:)];
        CCMenuItemFont *itemnetdz = [CCMenuItemFont itemFromString:@"联网对撸" target:self selector:
                                     @selector(onNetDZ:)];
        
        CCMenu *menu = [CCMenu menuWithItems: itemdanji, itemduizhan,itemnetdz,nil];
		[menu alignItemsVertically];
        
        [self addChild: menu];
	}
	return self;
}

-(void) onDanji: (id) sender
{
    [[LayerManager sharedLayerMag] toBaiQiLayer];
}

-(void) onDuiZhan: (id) sender
{
	[[LayerManager sharedLayerMag] toBaiQiLayer];
}

-(void) onNetDZ: (id) sender
{
	[[LayerManager sharedLayerMag] toBaiQiLayer];	
}
@end
